<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>技术社区</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <!--引入bootstrap的css样式-->
    <link rel="stylesheet" href="/css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <!--自定义css样式-->
    <link rel="stylesheet" href="/css/community.css">
    <!--引入favicon-->
    <link rel="shortcut icon" th:href="@{/favicon.ico}"/>
    <link rel="bookmark" th:href="@{/favicon.ico}"/>
    <!--引入jQuery库 js样式才能生效-->
    <script src="/js/jquery-3.4.1.min.js"></script>
    <!--bootstrap js type="application/javascript"记得加上-->
    <script src="/js/bootstrap.min.js" type="application/javascript"></script>
    <script type="application/javascript">
        window.onload=function () {
            // debugger;
            var closeable = window.localStorage.getItem("closeable");
            if(closeable=="true"){
                window.close();
                closeable.localStorage.removeItem("closeable");
            }
        }
    </script>


</head>
<body>
<!--导航栏-->
<div th:insert="~{navigation.html :: nav}"></div>
<!--流式布局容器-->
<div class="container-fluid main">
    <div class="row">
        <!--左半部分-->
        <div class="col-lg-9 col-md-12 col-sm-12 col-xs-12">
            <h2><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 发起</h2>
            <hr>
            <!--问题列表-->
            <div class="media" th:each="questionDto : ${pagination.data}">
                <!--用户头像-->
                <div class="media-left">
                    <a href="#">
                        <img class="media-object img-rounded" th:src="@{${questionDto.user.avatarUrl}}">
                    </a>
                </div>
                <!--问题内容-->
                <div class="media-body">
                    <h4 class="media-heading">
                        <a th:href="@{'/question/'+${questionDto.id}}" th:text="${questionDto.title}"></a>
                    </h4>
                    <!--<span th:text="${questionDto.description}"></span><br>-->
                    <span class="text-color-999"> <span th:text="${questionDto.commentCount==null?0:questionDto.commentCount}"></span> 个回复 • <span th:text="${questionDto.viewCount==null?0:questionDto.viewCount}"></span> 个浏览 • <span th:text="${#dates.format(questionDto.gmtCreate,'yyyy-MM-dd HH:mm')}"></span></span>
                </div>
            </div>
            <!--分页栏-->
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <!--第一页-->
                    <li th:if="${pagination.showFirstPage}">
                        <a  th:href="@{/(page=1,search=${search})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;&lt;</span>
                        </a>
                    </li >
                    <!--上一页-->
                    <li th:if="${pagination.showPrevious}">
                        <a th:href="@{/(page=${pagination.page-1},search=${search})}" aria-label="Previous">
                            <span aria-hidden="true">&lt;</span>
                        </a>
                    </li >
                    <!--页码-->
                    <li th:each="  page : ${pagination.pages}" th:class="${pagination.page==page}?'active':''">
                        <a th:href="@{/(page=${page},search=${search})}" th:text="${page}"></a>
                    </li>
                    <!--下一页-->
                    <li th:if="${pagination.showNext}">
                        <a th:href="@{/(page=${pagination.page+1},search=${search})}" aria-label="Previous">
                            <span aria-hidden="true">&gt;</span>
                        </a>
                    </li >
                    <!--最后一页-->
                    <li th:if="${pagination.showEndPage}">
                        <a th:href="@{/(page=${pagination.totalPage},search=${search})}" aria-label="Previous">
                            <span aria-hidden="true">&gt;&gt;</span>
                        </a>
                    </li >
                </ul>
            </nav>
        </div>
        <!--右半部分-->
        <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <h3 style="margin: 20px 90px;">关注站长微信</h3>
                <img src="/images/wechat.png" class="img-thumbnail question-wechat">
            </div>
        </div>
    </div>
</div>
<!--页尾-->
<div th:insert="~{foot.html :: foot}"></div>
</body>
</html>